open FILE, "<:utf8", "C:\\Documents and Settings\\R19338\\Desktop\\meli_joe_fr_102_1018.xml";
open WFILE, ">:utf8", "C:\\Documents and Settings\\R19338\\Desktop\\2.txt";

my $file_contents = '';

while (<FILE>) {
		$file_contents .= $_;
}
while ($file_contents =~ /(<product>.*?<\/product>)/isg){
	$one_product = $1;
	if ($one_product =~ /<ProductId>(.*?)<\/ProductId>/ig) {
		print WFILE $1."\n";
	}
}